const path = require('path')

let str = path.join('./a/b','.c/d')
let str1 = path.join('../a/c','../c/d')
let str2 = path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')
console.log(str)
console.log(str1)
console.log(str2)

/* 
a\b\.c\d
..\a\c\d
\foo\bar\baz\asdf
 */